package com.yz.group1.group_1.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yz.group1.group_1.entity.Doctor;
import com.yz.group1.group_1.mapper.DoctorMapper;
import com.yz.group1.group_1.service.DoctorService;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> implements DoctorService {

    @Override
    public List<Doctor> getByDepartmentId(Integer departmentId) {
        QueryWrapper<Doctor> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("department_id", departmentId).eq("status", 1);
        return baseMapper.selectList(queryWrapper);
    }

    @Override
    public List<Doctor> listAllDoctors() {
        QueryWrapper<Doctor> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", 1);
        return baseMapper.selectList(queryWrapper);
    }
}